package objects;

import java.awt.Color;
import java.awt.Graphics;

import gfx.Drawable;
import gfx.Tickable;
import core.Vector2;

/**
 * The superclass for all entities.
 * 
 * @author robert.kraneis
 */
public class Entity implements Drawable, Tickable {
	
	protected int id;
	protected Vector2 pos, size;
	protected double angle;
	protected boolean removed;
	private static int idCount;
	
	private static int generateID() {
		return idCount++;
	}
	
	public Entity(Vector2 pos, double angle, Vector2 size) {
		this.id = generateID();
		this.pos = pos;
		this.angle = angle;
		this.size = size;
	}

	@Override
	public void tick() {
	}

	@Override
	public int getID() {
		return id;
	}

	@Override
	public void render(Graphics g) {
	}

	@Override
	public boolean removed() {
		return removed;
	}

	@Override
	public Vector2 getPos() {
		return pos;
	}

	@Override
	public Color getColor() {
		return null;
	}

	@Override
	public Vector2 getSize() {
		return size;
	}

	public double getAngle() {
		return angle;
	}

	public void setAngle(double angle) {
		this.angle = angle;
	}

	public void setPos(Vector2 pos) {
		this.pos = pos;
	}
	
}
